<div class="form">

    <?php
    $form = $this->beginWidget('CActiveForm', array(
                'id' => 'producto-form',
                'htmlOptions' => array('enctype' => 'multipart/form-data'),
                'enableAjaxValidation' => false,
            ));
    ?>

    <div class="message info">Campos con * son requeridos.</div>

    <p>
        <?php echo $form->labelEx($model, 'nombre'); ?>
        <br/>
        <?php echo $form->textField($model, 'nombre', array('size' => 25, 'maxlength' => 25, 'class' => 'text')); ?>
        <?php echo Nhtml::error($model, 'nombre'); ?>
    </p>

    <p>
        <?php echo $form->labelEx($model, 'vigencia'); ?>
        <br/>

        <?php //echo $form->textField($model, 'vigencia', array('class' => 'text date_picker')); ?>
        <?php

        
        $this->widget('zii.widgets.jui.CJuiDatePicker', array(
            'name' => 'Producto[vigencia]',
            'model' => $model,
            'attribute' => 'vigencia',
            'language' => 'es',
            // additional javascript options for the date picker plugin
            'options' => array(
                'showAnim' => 'fold',
            ),
            'htmlOptions' => array(
                'class' => 'text date_picker'
            ),
        ));

        ?>
        <?php echo Nhtml::error($model, 'vigencia'); ?>
    </p>

    <p>
        <?php echo $form->labelEx($model, 'precio'); ?>
        <br/>
        <?php echo $form->textField($model, 'precio', array('class' => 'text')); ?>
        <?php echo Nhtml::error($model, 'precio'); ?>
    </p>

    <p>
        <?php echo $form->labelEx($model, 'menu'); ?>
        <br/>
        <?php echo Chtml::activeFileField($model, 'menu',array('class' => 'file')); ?>
        <?php echo Nhtml::error($model, 'menu', array('style' => 'margin-left:80px;')); ?>
    </p>
    <p>
        <?php echo $form->labelEx($model, 'categoria_id'); ?>
        <br/>
        <?php
        $seleccione = array(null => "Seleccione un campo");
        $categorias = Chtml::listData(Categoria::model()->findAll(), "id", "nombre");
        echo $form->dropDownList($model, "categoria_id", $seleccione + $categorias, array('class' => 'styled'));
        ?>
        <?php echo Nhtml::error($model, 'categoria_id'); ?>
    </p>

    <p>
        <?php echo CHtml::submitButton('Guardar', array('class' => 'submit')); ?>
    </p>

    <?php $this->endWidget(); ?>

</div><!-- form -->